/**
 * 系统资源js
 */
var goldAccount= {
	curPage:1,
	pageSize:10,
	dataCache:null,
	payBackPhone01:null,
	payBackPhone02:null,
	payBackMail01:null,
	payBackMail02:null,

	//查询版本信息
	showInfo:function(){
		var url= 'mgr/safetyCtrl/getGoldAccountInfo';
		var params={
			'userId':userId
		};
		
		var cb = function(data) {
			if (data.resultCode == 200) {
				var data = data.result;
				$("input[name='payBackPhone01']").val(data.field01);
				$("input[name='payBackPhone02']").val(data.field02);
				$("input[name='payBackMail01']").val(data.field03);
				$("input[name='payBackMail02']").val(data.field04);

				goldAccount.payBackPhone01 = data.field01;
				goldAccount.payBackPhone02 = data.field02;
				goldAccount.payBackMail01 = data.field03;
				goldAccount.payBackMail02 = data.field04;


				$("input[name='payBackPhone01']").attr("disabled");
				$("input[name='payBackPhone02']").attr("disabled");
				$("input[name='payBackMail01']").attr("disabled");
				$("input[name='payBackMail02']").attr("disabled");


				jsUtils.controlFunctionBtn();
			}else{
				alert(data.msg);
			}
		};
		sendApiNoLoad(url, params, cb, 'POST');
	},
	
	bindBtn:function(){
		$('#payBackUpdate').unbind();
		$('#payBackUpdate').on('click',function(){
			art.dialog.data('payBackPhone01', goldAccount.payBackPhone01);
			art.dialog.data('payBackPhone02', goldAccount.payBackPhone02);
			art.dialog.data('payBackMail01', goldAccount.payBackMail01);
			art.dialog.data('payBackMail02', goldAccount.payBackMail02);

			var path = APP_ADDRESS + 'mgr/safety/goldAccount/goldAccountPayBackUpdate.jsp';
			art.dialog.open(path,
			{
				title : '回款安全设置',
				width : 600,
				height : 400,
				ok : function() {
					var returnStatus = this.iframe.contentWindow
							.submitForm();
					if (returnStatus) {
						art.dialog.close();
						goldAccount.init();
					}
					return returnStatus;
				},
				cancel : true
			});
		});
	},
		
	init : function() {
		jsUtils.controlFunctionBtn();
		goldAccount.showInfo();
		goldAccount.bindBtn();
	}
};

$(document).ready(function() {
	goldAccount.init();
});

//提供给外部刷新调用
function refashData(){
	goldAccount.setPageChange(null);
	goldAccount.search();
}


